let appSalary = {
  template: `<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
  <h2 class="sub-header">
    <slot name="title"></slot>
    <slot name="icon" />
  </h2>
    <div class="table-responsive">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>#</th>
            <th>姓名</th>
            <th>工资</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item, index) in empList">
            <td>{{ index + 1 }}</td>
            <td>{{ item.name }}</td>
            <td>{{ item.salary }}</td>
            <td><a href="javascript:;" @click="removeItem(index)">删除</a></td>
            
          </tr>
        </tbody>
      </table>
    </div>
  </div></div>`,
  props: ["empList"],

  methods: {
    removeItem(index) {
      console.log(index); //子组件
      this.$emit("delMan", index); //利用$emit触发自定义事件 delMan;第一个参数是事件名，后面都是数据
    },
  },
};
